<!DOCTYPE html>
<html lang="zh-hans">

<head>
    <meta charset="UTF-8">
    <link rel="shortcut icon" href="./favourite.gif" type="image/x-icon">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>46 响应式布局</title>
    <style>
        .item-wrapper {
            display: flex;
            max-width: 1000px;
            flex-wrap: wrap;
            margin: 0 auto;
        }
        
        .item-wrapper .item {
            width: 20%;
            box-sizing: border-box;
            padding: .5em;
        }
        
        .item-wrapper .item .content {
            border: solid 2px blue;
            display: flex;
            flex-direction: column;
            padding: .7em;
            height: 278px;
        }
        
        .item-wrapper .item .content .photo {
            height: 229px;
            order: -1;
            border: solid 2px red;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .item-wrapper .item h2 {
            font-size: 100%;
            margin: 0;
            padding: 0;
        }
        
        .item-wrapper .item img {
            max-width: 100%;
            max-height: 100%;
        }
        
        @media (max-width: 920px) {
            .item-wrapper .item {
                width: 25%;
            }
        }
        
        @media (max-width: 800px) {
            .item-wrapper .item {
                width: 33.333333%;
            }
        }
        
        @media (max-width: 700px) {
            .item-wrapper .item {
                width: 50%;
            }
        }
        
        @media (max-width: 500px) {
            .item-wrapper .item {
                width: 100%;
            }
            .item-wrapper .item .content .photo {
                order: 1;
            }
        }
    </style>
</head>

<body>
    <div class="item-wrapper">
        <div class="item">
            <div class="content">
                <h2>仙人掌《猎鹰与冬兵》先导</h2>
                <div class="photo"><img src="./xyc.jpg" /></div>
            </div>
        </div>
        <div class="item">
            <div href="#" class="content">
                <h2>Chrome</h2>
                <div class="photo">
                    <img src="./chrome.jpg" />
                </div>
            </div>
        </div>
        <div class="item">
            <div class="content">
                <h2>山中访一日《猎鹰与冬兵》先导</h2>
                <div class="photo"><img src="./xyc.jpg" /></div>
            </div>
        </div>
        <div class="item">
            <div class="content">
                <h2>世上已千年《猎鹰与冬兵》先导</h2>
                <div class="photo"><img src="./xyc.jpg" /></div>
            </div>
        </div>
        <div class="item">
            <div class="content">
                <h2>仙人掌《猎鹰与冬兵》先导</h2>
                <div class="photo"><img src="./xyc.jpg" /></div>
            </div>
        </div>
        <div class="item">
            <div class="content">
                <h2>图样图森破《猎鹰与冬兵》先导</h2>
                <div class="photo"><img src="./xyc.jpg" /></div>
            </div>
        </div>
        <div class="item">
            <div class="content">
                <h2>仙人掌《猎鹰与冬兵》先导</h2>
                <div class="photo"><img src="./xyc.jpg" /></div>
            </div>
        </div>
        <div class="item">
            <div class="content">
                <h2>仙人掌《猎鹰与冬兵》先导</h2>
                <div class="photo"><img src="./xyc.jpg" /></div>
            </div>
        </div>
        <div class="item">
            <div class="content">
                <h2>仙人掌《猎鹰与冬兵》先导</h2>
                <div class="photo"><img src="./xyc.jpg" /></div>
            </div>
        </div>

    </div>
</body>

</html>